let list = document.querySelectorAll('.listbox > li');
console.log(list);
let dots = document.querySelectorAll('.dot-box > span');
let ul = document.querySelector('.slide-content > ul');

let index = 1;

let lastIndex = 1;
dots.forEach((el, elIndex) => {
    el.addEventListener('click', () => {
      // 获取当前点击的小圆点下标, 更换index的值就就可以实现轮播图和小圆点下标一致
      index = elIndex + 1;
      ul.style.transform = `translateX(-${index}00%)`;
      dotcoloe
      
    });
  });
  
  function dotcoloe(){
    dots[index-1].classList.add('active');
    dots[lastIndex-1].classList.remove('active');
    lastIndex = index;
  }